/*
  Button

  Turns on and off the built-in LED when the built-in button is
  pressed.

  Ported to Maple from the Arduino example 27 May 2011
  by Marti Bolivar
*/

int Count=0;
void setup() {
  // Initialize the built-in LED pin as an output:
  pinMode(PC13, OUTPUT);
  // Initialize the built-in button (labeled BUT) as an input:
  pinMode(PB6, INPUT);
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (digitalRead(PB6) == HIGH) {
    digitalWrite(PC13, HIGH);
     Count=Count+1;
    Serial.write(Count);
  }else{
    digitalWrite(PC13, LOW);
//    Serial.write(2);
    }
   delay(100);
//   Serial.write('xxxxx');
}
